Imports System
Imports System.Collections.Generic
Imports FizzWare.NBuilder

Public Class ProductRepository
    Implements IProductRepository

    Public Sub New()
    End Sub

    Public Function GetAll() As IList(Of Product) Implements IProductRepository.GetAll
        Dim products As IList(Of Product) = Builder(Of Product).CreateListOfSize(10).Build()
        Return products
    End Function

    Public Function GetProductById(ByVal productId As Integer) As Product Implements IProductRepository.GetProductById
        Dim products As IList(Of Product) = Me.GetAll()
        Return products(productId - 1)
    End Function

    Public Sub Persist(ByVal product As Product) Implements IProductRepository.Persist
        Console.WriteLine("Do something here to persist changes")
    End Sub
End Class
